package org.opportunity.wishlist.travelwish.action;

import java.util.Iterator;
import java.util.List;
import java.util.Set;

import org.opportunity.wishlist.travelwish.pojo.dao.FacetDao;
import org.opportunity.wishlist.travelwish.pojo.model.Facet;
import org.opportunity.wishlist.travelwish.pojo.model.Focus;

import com.opensymphony.xwork2.ActionSupport;

public class FacetAction extends ActionSupport {

    private static final long serialVersionUID = 873240975010159944L;
    
    @Override
    public String execute() throws Exception {
       List<Facet> list = null;
       FacetDao dao = new FacetDao();
       try {
	   
	list = dao.findAll();
	for (Facet facet : list) {
	    System.out.println(facet.getPropertyName());
	    Set<Focus> focus = facet.getFocus();
	    for (Iterator<Focus> iterator = focus.iterator(); iterator.hasNext();) {
		Focus focusFacet = (Focus) iterator.next();
		System.out.println(focusFacet.getPropertyName());
	    }
	}
	
    } catch (Exception e) {
	e.printStackTrace();
    }
       
       return SUCCESS;
    }

}
